import request from '@/utils/request'

export function deleteChapter(id) {
    return request({
        url: `/course/chapter/deleteChapter/${id}`,
        method: 'delete',
    })
}

export function getChapterById(id) {
    return request({
        url: `/course/chapter/getChapterById/${id}`,
        method: 'get',
    })
}

export function saveOrUpdateChapter(chapter) {
    return request({
        url: `/course/chapter/saveOrUpdateChapter`,
        method: 'post',
        data: chapter
    })
}

export function getChaptersByCourseId(courseId) {
    return request({
        url: `/course/chapter/getChaptersByCourseId/${courseId}`,
        method: 'get',
    })
}

export function updateChapterAndVideoSort(chapterSortVos) {
    return request({
        url: `/course/chapter/updateChapterAndVideoSort`,
        method: 'post',
        data: chapterSortVos
    })
}

